package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.utils.getTimer;
	
	import vno.fux.GlobalVar;
	import vno.fux.init.Initer;
	import vno.sci.mapEditor.MapEditor;
	import vno.sci.window.Minimap;

	
	[SWF(frameRate="30")]
	public class FuxMain extends Sprite
	{
		private var _enter:Number=0;
		private var _exit:Number=0;
		public function FuxMain()
		{
			this.addEventListener(Event.ADDED_TO_STAGE, begin);
//			stage.scaleMode = StageScaleMode.NO_SCALE;
//			stage.align = StageAlign.TOP_LEFT;
//			new MapEditor(stage);
		}
		
		protected function begin(event:Event):void
		{
			this.removeEventListener(Event.ADDED_TO_STAGE, begin);
			//====Please reserve the two lines below====
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			//=========================================
			GlobalVar.stage = stage;
			Initer.init(new XML, this);
			this.stage.addEventListener(Event.ENTER_FRAME, start);

			//this.stage.addEventListener(Event.ENTER_FRAME, enter);
		}
		protected function enter(event:Event):void
		{
			_exit = getTimer();
			var deta:Number = _exit - _enter;
			if(deta>0)
				trace(deta);
			_enter = getTimer();
		}
		
		protected function start(event:Event):void
		{
			this.stage.removeEventListener(Event.ENTER_FRAME, start);
			var initer:Initer = Initer.getInstance();
			initer.init();
		}
	}
}